<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>邮箱验证</title>
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script>
			 $(function(){
			 	$("#regform").submit(function(){
			 		var e=$("#email").val();
			 		if(e.length==0||e.indexOf("@")<1||e.indexOf(".")<1)
			 		{
			 			alert("格式不正确");
			 			return false;
			 		}
			 		var p=$("#pass").val();
			 		if(p.length<6)
			 		{
			 			alert("密码长度必须是6位以上！");
			 			return false;
			 		}
			 		if(p!=$("#repass").val())
			 		{
			 			alert("两次密码输入的不一致");
			 			return false;
			 		}
			 		return true;
			 	});
			 });
		</script>
	</head>
	<body>
		<form action="jq1.html" method="get" id="regform">
			<p>
				<label for="email">电子邮件</label>
				<input type="email" name="youremail" id="email">
			</p>
			<p>
				<label for="pass">密码</label>
				<input type="password" name="yourpass" id="pass">
			</p>
			<p>
				<label for="repass">再次输入密码</label>
				<input type="password" name="repass" id="repass">
			</p>
			<p>
				<input type="submit"  value="注册"/>
			</p>
		</form>
	</body>
</html>
